unit CreateSmartForm;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
  Vcl.Forms, Datasnap.DBClient, LoginDlg, uBaseIntf;

type
  TCreateSmartForm = class(TComponent, ICreateForm)
  private
    LoginDialog: TDlgLogin;
  public
    function GetForm(MainForm: TForm; const Address: String; bShow: Boolean): TForm;
    function GetLoginDialog: TForm;
  end;

implementation

{ TCreateSmartForm }

function TCreateSmartForm.GetForm(MainForm: TForm; const Address: String;
  bShow: Boolean): TForm;
var
  Child: TForm;
  sAddress, s1, s2, xmlFile, sServer: String;
  FormCode, FormName: String;
  cdsTmp: TClientDataSet;
begin
  sAddress := Address;
  LoginDialog := TDlgLogin.Create(Self.Owner);
  try
    //if LoginDialog.Execute(AServer) then
    //begin
      LoginDialog.ShowModal;
      LoginDialog.Refresh;
    //end;
  finally
    //FreeAndNil(LoginDialog);
  end;
  Result := nil;
end;

function TCreateSmartForm.GetLoginDialog: TForm;
begin
  Result := LoginDialog;
end;

procedure ForceReferenceToClass(C: TClass);
begin

end;

initialization
  ForceReferenceToClass(TCreateSmartForm);

end.
